﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Clock
{
    class Clock
    {
        public event EventHandler Tick, Alarm;
        Timer timer;
        public Clock()
        {
            timer = new Timer((o) => {
                Tick(this, null);
                Alarm(this, null);
            }, null, -1, -1);
        }

        public void Start()
        {
            timer.Change(0, 1000);
        }
        public void Stop()
        {
            timer.Change(-1, -1);
        }
    }
}
